package lar.game.physics;

public class Rotation
{
	private final double rotation;
	
	public Rotation (double Degrees)
	{
		rotation = Math.toRadians(Degrees);
	}
	
	public Rotation (Vector vector)
	{
		rotation = Math.atan2(vector.GetY(), vector.GetX());
		
	}
	
	/*public Rotation (String init)
	{
		rotation = Double.parseDouble(init);
	}
	
	public String Serialize()
	{
		return "" + rotation;
	}*/
	
	public Rotation Add(double Degrees)
	{
		return new Rotation(AsDegrees() + Degrees);
	}
	
	public double AsDegrees()
	{
		return Math.toDegrees(rotation);
	}
	
	public double Cos(Rotation other)
	{
		return Math.cos(rotation - other.rotation);
	}
	
	public double ElementX()
	{
		return Math.cos(rotation);
	}
	
	public double ElementY()
	{
		return Math.sin(rotation);
	}
}
